using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ARStructTypeInfo(Name = "ARDisplayInstanceStruct", NumberOfMembers = 2u, MembersTypeString = "System.Int32|ARPropValue"), ClassInterface, Guid("347ee1ae-24d4-4c97-9905-29e14c850518"), ProgId("BMC.ARSystem.DisplayInstance")]
	public class DisplayInstance : DictionaryBase, ICloneable
	{
		[Guid("e718ba5a-a069-4c78-b395-f996c5f3eef5")]
		public enum EnableOption
		{
			Default,
			ReadOnly,
			ReadWrite,
			Disabled
		}
		[Guid("6fea2dfe-fad1-42ba-bca5-ca98beecba95")]
		public enum JustificationOption
		{
			Default,
			Left,
			Center,
			Fill,
			Right,
			Tile
		}
		[Guid("1cba902e-3a92-4e48-821b-af51d3ef08aa")]
		public enum AlignmentOption
		{
			Default,
			Top,
			Middle,
			Fill,
			Bottom,
			Tile
		}
		public virtual object this[int propId]
		{
			get
			{
				return base.get_Dictionary().get_Item(propId);
			}
			set
			{
				base.get_Dictionary().set_Item(propId, value);
			}
		}
		public virtual ICollection Keys
		{
			get
			{
				return base.get_Dictionary().get_Keys();
			}
		}
		public virtual ICollection Values
		{
			get
			{
				return base.get_Dictionary().get_Values();
			}
		}
		public string Label
		{
			get
			{
				object property = this.GetProperty(20);
				if (property != null)
				{
					return property.ToString();
				}
				return "";
			}
			set
			{
				this.SetProperty(20, value);
			}
		}
		public bool Visible
		{
			get
			{
				object property = this.GetProperty(4);
				return property != null && Convert.ToUInt32(property) != 0u;
			}
			set
			{
				this.SetProperty(4, value ? 1 : 0);
			}
		}
		public DisplayInstance.EnableOption Enabled
		{
			get
			{
				object property = this.GetProperty(5);
				if (property != null)
				{
					return (DisplayInstance.EnableOption)Convert.ToInt32(property);
				}
				return DisplayInstance.EnableOption.Default;
			}
			set
			{
				this.SetProperty(5, Convert.ToInt32(value));
			}
		}
		public DisplayInstance.JustificationOption Justification
		{
			get
			{
				object property = this.GetProperty(90);
				if (property != null)
				{
					return (DisplayInstance.JustificationOption)Convert.ToInt32(property);
				}
				return DisplayInstance.JustificationOption.Default;
			}
			set
			{
				this.SetProperty(90, Convert.ToInt32(value));
			}
		}
		public DisplayInstance.AlignmentOption Alignment
		{
			get
			{
				object property = this.GetProperty(91);
				if (property != null)
				{
					return (DisplayInstance.AlignmentOption)Convert.ToInt32(property);
				}
				return DisplayInstance.AlignmentOption.Default;
			}
			set
			{
				this.SetProperty(91, Convert.ToInt32(value));
			}
		}
		public string LabelColorText
		{
			get
			{
				object property = this.GetProperty(24);
				if (property != null)
				{
					return property.ToString();
				}
				return "";
			}
			set
			{
				this.SetProperty(24, value);
			}
		}
		public string LabelFontStyle
		{
			get
			{
				object property = this.GetProperty(22);
				if (property != null)
				{
					return property.ToString();
				}
				return "";
			}
			set
			{
				this.SetProperty(22, value);
			}
		}
		public uint LabelFontSize
		{
			get
			{
				object property = this.GetProperty(23);
				if (property != null)
				{
					return Convert.ToUInt32(property);
				}
				return 0u;
			}
			set
			{
				this.SetProperty(23, value);
			}
		}
		[ComVisible(false)]
		public IDictionary Properties
		{
			get
			{
				return base.get_Dictionary();
			}
			set
			{
				IDictionaryEnumerator enumerator = value.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						DictionaryEntry dictionaryEntry = (DictionaryEntry)enumerator.get_Current();
						base.get_Dictionary().set_Item(Convert.ToInt32(dictionaryEntry.get_Key()), dictionaryEntry.get_Value());
					}
				}
				finally
				{
					IDisposable disposable = enumerator as IDisposable;
					if (disposable != null)
					{
						disposable.Dispose();
					}
				}
			}
		}
		internal static DisplayInstance createInstance(object[] rawData, Server server)
		{
			ARTypeMgr arg_2F_0 = ARTypeMgr.Instance;
			Type arg_2F_1 = typeof(DisplayInstance);
			string arg_2F_2 = "System.Int32";
			int[] keyIndex = new int[1];
			IDictionary dictionary = arg_2F_0.BuildCustomDictionaryFromVariant(arg_2F_1, arg_2F_2, keyIndex, "ARPropValue", new int[]
			{
				1
			}, rawData, server);
			return (DisplayInstance)dictionary;
		}
		public virtual void Add(int propId, object value)
		{
			base.get_Dictionary().Add(propId, value);
		}
		public virtual bool Contains(int propId)
		{
			return base.get_Dictionary().Contains(propId);
		}
		public virtual bool ContainsKey(int propId)
		{
			return base.get_Dictionary().Contains(propId);
		}
		public virtual bool ContainsValue(object value)
		{
			IEnumerator enumerator = base.get_Dictionary().get_Values().GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					object current = enumerator.get_Current();
					if (current == value)
					{
						return true;
					}
				}
			}
			finally
			{
				IDisposable disposable = enumerator as IDisposable;
				if (disposable != null)
				{
					disposable.Dispose();
				}
			}
			return false;
		}
		public virtual void Remove(int propId)
		{
			base.get_Dictionary().Remove(propId);
		}
		public bool PropertyExists(int propTag)
		{
			return this.Properties.Contains(Convert.ToInt32(propTag));
		}
		public object GetProperty(int propTag)
		{
			if (this.PropertyExists(propTag))
			{
				return this.Properties.get_Item(propTag);
			}
			return null;
		}
		public void SetProperty(int propTag, object val)
		{
			this.Properties.set_Item(propTag, val);
		}
		public void RemoveProperty(int propTag)
		{
			this.Properties.Remove(propTag);
		}
		public object Clone()
		{
			DisplayInstance displayInstance = new DisplayInstance();
			IDictionaryEnumerator enumerator = base.get_Dictionary().GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					DictionaryEntry dictionaryEntry = (DictionaryEntry)enumerator.get_Current();
					displayInstance[Convert.ToInt32(dictionaryEntry.get_Key())] = dictionaryEntry.get_Value();
				}
			}
			finally
			{
				IDisposable disposable = enumerator as IDisposable;
				if (disposable != null)
				{
					disposable.Dispose();
				}
			}
			return displayInstance;
		}
	}
}
